If you run the program in the CPIC you will see that it continually loops around testing the input bit and branching appropriately. If you press the input button connected to bit 0 of PORTB you will see the program "notice" that the bit has changed and it will turn on bit 0 of PORTA.

I am using the usual trick to make sure the program runs forever. The while condition will continue while its condition is set to a non-zero (i.e. true) value. This means that while(1) will repeat a block of code for ever.

Load Program 2.1 into the PICmicro and execute it. Note that it works just like a real light switch!